//
//  TouchableMaskView.m
//  us
//
//  Created by karry on 2025/5/27.
//

#import "TouchableMaskView.h"

@implementation TouchableMaskView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
    // 如果贴纸选择器在下方区域，我们判断是否点击到它
    
    UIView *view = [super hitTest:point withEvent:event];
    if (view == self) {
        // 其他区域点击了，执行关闭回调，同时返回 nil 表示事件穿透
        if (self.onTapOutside) {
            self.onTapOutside();
        }
        return nil;
    }
    
    return view;// 事件透传到底部 view（即让底部也能点击）
}


@end
